home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
doom
/
axxwar_1.zip
/
SOURCES
/
LASERSIG.QC
< prev
next >
Wrap
Text File
|
1997-03-04
|
4KB
|
135 lines
// AxxWars 0.8
/*
==============
SightThink
==============
*/
void () SightThink =
{
local vector org;
local vector src;
local entity me;
local float temp;
me=self.owner;
makevectors(me.v_angle);
org = me.origin + v_up*16;
traceline (org, org + v_forward*2048, FALSE, self);
setorigin(self,trace_endpos-v_forward*10);
self.nextthink=time+0.1;
// check if target is damageable and set proper model
if (trace_ent.takedamage)
setmodel (self, "progs/cross2.mdl");
else
setmodel (self, "progs/cross1.mdl");
if(( me.ID_ent != trace_ent) || (time > me.ID_time))
{
if( (trace_ent.classname == "player") || (trace_ent.classname == "cbot"))
{
if(trace_ent.team!=me.team)
sprint(me,"FOE: ");
else sprint(me,"FRIEND: ");
sprint(me,trace_ent.netname);
temp=trace_ent.weapon;
if(temp==IT_AXE)
sprint(me,"- Axe");
else if(temp==IT_SNIPER)
sprint(me,"- Sniper");
else if(temp==IT_SUPER_SHOTGUN)
sprint(me,"- Super Shotgun");
else if(temp==IT_NAILGUN)
sprint(me,"- Nailgun");
else if(temp==IT_SUPER_NAILGUN)
sprint(me,"- Super Nailgun");
else if(temp==IT_GRENADE_LAUNCHER)
sprint(me,"- Grenade Launcher");
else if(temp==IT_ROCKET_LAUNCHER)
sprint(me,"- Rocket Launcher");
else if(temp==IT_LIGHTNING)
sprint(me,"- Lightning Gun");
else
sprint(me,"- Unknown Weapon");
}
else if( !me.deadflag && trace_ent.flags & FL_MONSTER)
{
sprint(me,"ID: ");
if(trace_ent.classname=="monster_ogre") sprint(me,"Ogre (Chainsaw/grenades)");
else if(trace_ent.classname=="monster_knight") sprint(me,"Knight (Sword)");
else if(trace_ent.classname=="monster_shambler") sprint(me,"Shambler (Claws/lightning bolt)");
else if(trace_ent.classname=="monster_demon1") sprint(me,"Fiend (Claw/horn)");
else if(trace_ent.classname=="monster_wizard") sprint(me,"Scrag (Particle beam)");
else if(trace_ent.classname=="monster_zombie") sprint(me,"Zombie (Chunk 'o flesh)");
else if(trace_ent.classname=="monster_dog") sprint(me,"Rottweiler (Tooth/claw)");
else if(trace_ent.classname=="monster_hell_knight") sprint(me,"Death Knight (Sword/flame fan)");
else if(trace_ent.classname=="monster_tarbaby") sprint(me,"Spawn (Corrosive touch)");
else if(trace_ent.classname=="monster_vomit") sprint(me,"Vore (Firepod)");
else if(trace_ent.classname=="monster_enforcer") sprint(me,"Enforcer (Laser rifle)");
else if(trace_ent.classname=="monster_army") sprint(me,"Grunt (Shotgun)");
else sprint(me,trace_ent.classname);}
else return;
sprint(me,"\n");
me.ID_time=time+3;
me.ID_ent=trace_ent;}
// move sight at line of sight collision
self.angles = vectoangles(v_forward);
setorigin(self, trace_endpos );
// mark think to update sight position
self.nextthink = time + 0.05;
};
/*
=============
SightMake
=============
*/
void () SightMake =
{
local entity cross;
self.sight_out = TRUE;
cross = spawn ();
cross.owner = self;
cross.movetype = MOVETYPE_NOCLIP;
cross.solid = SOLID_NOT;
setmodel (cross, "progs/cross1.mdl");
cross.classname = "laser_sight";
setorigin( cross, self.origin );
cross.think = SightThink;
cross.nextthink = time + 0.05;
};
/*
=============
SightOff
=============
*/
void () SightOff =
{
local entity e; // AXXLS
e = find( world, classname, "laser_sight");
while (e)
{
if (e.classname == "laser_sight" && e.owner == self)
{
remove(e);
return;
}
e = nextent(e);
}
};